﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            //一维数组
            int[] arr = new int[10];
            for (int i = 0; i < arr.Length; i++)
            {
                Console.WriteLine(arr[i]);
            }
            int[] arr1 = new int[3] { 1, 2, 3 };
            for (int i = 0; i < arr1.Length; i++)
            {
                Console.WriteLine(arr1[i]);
            }
            string[] arr2 = { "l", "x" };
            for (int i = 0; i < arr2.Length; i++)
            {
                Console.WriteLine(arr2[i]);
            }


            //多维数组
            int[,] arr3 = { { 78, 12, 121 }, { 53, 12, 63 }, { 33, 66, 22 } };
            for (int i = 0; i < arr3.GetLength(0); i++)
            {
                for (int j = 0; j < arr3.GetLength(1); j++)
                {
                    Console.WriteLine(arr3[i, j]);
                }
            }



            //foreach的用法
            int[] fibarray = new int[] { 1, 2, 3, 4,5, 6 };
            foreach (int i in fibarray)
            {
                System.Console.Write(i);
            }


            //split的用法
            string str = "阵阵微风";
            string[] sArrsy = str.Split('a');
            var a = str.Split(',');
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine(a[i]);
            }
        }
    }
}





